<template>
  <div class="tableCom">
    <div class="tableHead">
      <div class="tableHeadItem" v-for="(item,index) in head" :key="index" :style="{flex:item.flex}">{{ item.title }}
      </div>
    </div>
    <!-- <Vue3SeamlessScroll :step="0.5" :wheel="true" :hover="true" :list="list" class="tableBody">
      <div class="tableBody2" v-for="(item, index) in list" :key="'item-' + index">
        <div
            v-for="(head, headIndex) in head"
            :key="'head-' + headIndex"
            class="tableBody2Item"
            :style="{flex: head.flex}"
        >
          <span class="num">{{ item[head.id] }}</span>
        </div>
      </div>
    </Vue3SeamlessScroll> -->
  </div>
</template>

<script>
// import {Vue3SeamlessScroll} from "vue3-seamless-scroll";

export default {
  name: "tableCom",
  // components: {Vue3SeamlessScroll},
  props: {
    head: {
      type: Array,
      default() {
        return [];
      }
    },
    list: {
      type: Array,
      default() {
        return [];
      }
    },
  }
}
</script>

<style lang="scss" scoped>
.tableCom {
  width: calc(100% - 30px);
  margin-left: 15px;
  position: relative;
  height: calc(100% - 0px);
  overflow: hidden;

  .tableHead {
    width: 100%;
    height: 40px;
    position: relative;
    //background: rgba(48, 142, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    flex-direction: row;
    background: url("./assets/headerTopBg.png");
    background-size: 100% 100%;

    .tableHeadItem {
      font-size: 16px;
      font-family: MicrosoftYaHei;
      font-weight: 400;
      color: #A4C4FF;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: nowrap;
      flex-direction: row;
      flex: 1;
    }
  }

  .tableBody {
    position: relative;
    height: calc(100% - 40px);
    overflow: hidden;

    .tableBody2 {
      height: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: nowrap;
      flex-direction: row;
      position: relative;

      .line_left_bottom {
        width: 8px;
        height: 2px;
        background: #04CEF7;
        position: absolute;
        left: 0;
        bottom: 0;
      }

      .line_right_bottom {
        width: 8px;
        height: 2px;
        background: #04CEF7;
        position: absolute;
        right: 0;
        bottom: 0;
      }

      .tableBody2Item {
        font-size: 14px;
        font-family: MicrosoftYaHei;
        font-weight: 400;
        color: #A4C4FF;
        height: 100%;
        text-shadow: 0px 4px 10px rgba(0, 42, 108, 0.12);
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: nowrap;
        flex-direction: row;
        flex: 1;
        min-width: 0;

        .num {
          width: calc(100% - 0px);
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
          text-align: center;
          min-width: 0;
        }

      }
    }

    .tableBody2:nth-child(2n) {
      background: url("./assets/ItemBg.png") center bottom no-repeat;
      background-size: 100% 100%;
    }
  }
}

</style>
